package edu.sctu.practice.class02.hujie.cgs.assign03.One;
//几何对象GeometricObject
/**
 * Created by hj on 2015/10/22.
 */
public abstract class GeometricObject {
    //父类
    protected String color;//保护类型 表示图形的颜色
    protected double weight;//保护类型 表示图形的重量

    //Default construct默认构造？
    protected GeometricObject() {
        color = "white";
        weight = 1.0;
    }

    //Construct a geometric object 构造一个几何对象
    protected GeometricObject(String color, double weight) {
        this.color = color;
        this.weight = weight;
    }

    //Getter method for color
    public String getColor() {
        return color;
    }

    //Setter method for color
    public void setColor(String color) {
        this.color = color;
    }

    //Getter method for weight
    public double getWeight() {
        return weight;
    }

    //Setter method for weight
    public void setWeight(double weight) {
        this.weight = weight;
    }

    //静态方法Abstract method
    public abstract double findArea();
    //静态方法Abstract method
    public abstract double findPerimeter();
}
